<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>    
<%@include file="../common/common.jsp"%>  
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>我的足迹</title>
		<script type="text/javascript">
		$(function(){
			//	删除历史记录
			$('.my_tracks .history .wrap .delete').click(function(){
				$(this).parents('.wrap').remove();
			});
			$('.my_tracks .history ul li .img').hover(function(){
				$(this).parents('li').find('.del_single').css('display','block');
			},function(){
				$(this).parents('li').find('.del_single').css('display','none');
			});
			$('.my_tracks .history ul li .del_single').click(function(){
				//alert($(this).attr("data_id"))
				var data_id = $(this).attr("data_id");
				window.location.href="${ctx}/tracks/initTracks?id="+data_id;
				var $length = $(this).parents('ul').find('li').length;
				if($length <= 1){
					$(this).parents('.wrap').remove();
				}
				$(this).parents('li').remove();
			});
		});
		
		/**根据条件查询***/
		function findByName(className){
			window.location.href="${ctx}/tracks/initTracks?className="+className;
		}
		
		</script>
	</head>
	<body>
		<!--头部     开始-->
		<%@include file="../common/header.jsp"%> 
		<!--头部     结束-->

		<div class="same my_tracks container clearfix">
			<!-- 引入购物车文件    标签开始 -->
			<%@ include file="../common/top.jsp"%>
			<!-- 引入购物车文件    标签结束 -->
			
			<div class="top f16 clearfix">
				<span><a href="javascript:findByName('')">我的足迹</a></span>
				<span class="list">全部分类&nbsp;<img src="${ctx}/images/more-.png" alt="" />
					<ul class="f14">
						<c:forEach items="${classList}" var="goods">
							<li><a href="javascript:findByName('${goods}')">${goods}</a></li>
						</c:forEach>
					</ul>
				</span>
			</div>
			<div class="clearfix">
				<div class="history nine l">
					
					
					<div class="wrap">
						<p><span class="f18 three">本周浏览</span>&#x3000;<!-- <a href="javascript:;" class="delete">删除</a> --></p>
						<ul class="clearfix">
							<c:forEach items="${thisWeek }" var="goods">
								<li>
									<div class="img">
										<a href="${ctx}/goods/queryGoodsDetail?id=${goods.goodsId}" target="_blank">
											<c:choose>
												<c:when test="${goods.picture!=null }">
													<img src="${baseFile}${goods.picture}" alt="" />
												</c:when>
												<c:otherwise>
													<img src="${ctx }/images/track1.png" alt="" />
												</c:otherwise>
											</c:choose>
										</a>
										<span class="del_single" data_id="${goods.id}"><img src="${ctx}/images/del_order.png" alt="删除" /></span>
									</div>
									<p class="red">￥${goods.marketPrice }</p>
									<p class="name">${goods.goodsName }</p>
								</li>
							</c:forEach>
						</ul>
					</div>
					
					<div class="wrap">
						<p><span class="f18 three">上周浏览</span>&#x3000;<!-- <a href="javascript:;" class="delete">删除</a> --></p>
						<ul class="clearfix">
							<c:forEach items="${lastWeek }" var="last">
								<li>
									<div class="img">
										<a href="${ctx}/goods/queryGoodsDetail?id=${last.goodsId}" target="_blank">
											<c:choose>
												<c:when test="${last.picture!=null }">
													<img src="${baseFile}${last.picture}" alt="删除" />
												</c:when>
												<c:otherwise>
													<img src="${ctx }/images/track1.png" alt="删除" />
												</c:otherwise>
											</c:choose>
										</a>
										<span class="del_single" data_id="${last.id}"><img src="${ctx}/images/del_order.png" alt="" /></span>
									</div>
									<p class="red">￥${last.marketPrice }</p>
									<p class="name">${last.goodsName }</p>
								</li>
							</c:forEach>
						</ul>
					</div>
					
					<div class="wrap">
						<p><span class="f18 three">上周前更多浏览</span>&#x3000;<!-- <a href="javascript:;" class="delete">删除</a> --></p>
						<ul class="clearfix">
							<c:forEach items="${beforeWeek }" var="last">
								<li>
									<div class="img">
										<a href="${ctx}/goods/queryGoodsDetail?id=${last.goodsId}" target="_blank">
											<c:choose>
												<c:when test="${last.picture!=null }">
													<img src="${baseFile}${last.picture}" alt="删除" />
												</c:when>
												<c:otherwise>
													<img src="${ctx }/images/track1.png" alt="删除" />
												</c:otherwise>
											</c:choose>
										</a>
										<span class="del_single" data_id="${last.id}"><img src="${ctx}/images/del_order.png" alt="" /></span>
									</div>
									<p class="red">￥${last.marketPrice }</p>
									<p class="name">${last.goodsName }</p>
								</li>
							</c:forEach>
						</ul>
					</div>
				</div>
		</div></div>
		<!--底部-->
		<!-- 引入底部的页面  开始-->
		<%@include file="../common/bottom.jsp"%>
		<!-- 引入底部的页面  结束-->
	</body>
</html>

